<?php
/**
 * Created by PhpStorm.
 * User: sunzexin
 * Date: 2018/1/7
 * Time: 13:16
 */

namespace App\Http\Controllers\MiniProgram;


use App\Http\Logics\MiniProgram\SwiperLogic;
use App\Http\Traits\SwiperTrait;
use App\Http\Controllers\BaseController;
class SwiperController extends BaseController
{
    use SwiperTrait;
    /**
     * @SWG\Post(
     *     path="/swiper/list",
     *     tags={"Swiper"},
     *     description="获取轮播图列表",
     *     operationId="getSwiperList",
     *     produces={"application/json", "application/xml", "text/xml", "text/html"},
     *     @SWG\Parameter(
     *         name="category_id",
     *         in="query",
     *         description="分类ID",
     *         required=false,
     *         type="integer",
     *         format="int32"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="pet response"
     *     )
     * )
     */
    public function getSwiperList()
    {
        $category_id = $this->category_id;
        $data = [
            'category_id' => $category_id
        ];
        $response = SwiperLogic::getSwiperList($data);
        if ($response->code){
            return self::response($response->code, $response->message);
        }
        return self::response($response->code, $response->message, $response->data);
    }
}